/************************************
Creates Table 1 in-text
************************************/

clear
cd "C:\Users\jar68\OneDrive\Ongoing Work\Party Cues and Suspicion Paper\Final Datavserse\Data"
use "exp4_cleaned1.dta"
set more off
cd "C:\Users\jar68\OneDrive\Ongoing Work\Party Cues and Suspicion Paper\Final Datavserse\Table2"
log using "table2_log.log"



/*********************************************
Remove VPN and Independents
*********************************************/
keep if pid_2 !=.
keep if IP_Hub_recommend_block == 0

*Leaves 1027 observations

/*********************************************
Cleanings
*********************************************/

label def tr 1 "Baseline" 2 "Party Cue" 3 "Cue w/Insinuation" 4 "Insinuation", replace
label values treat_4 tr

label def lic 1 "Liberal Change" 0 "Conservative Change"
label def stc 0 "Stereotypical Change" 1 "Counter-Stereotypical Change" 
label values libchange lic
label values change stc

label def pi 1 "Democrat" 0 "Republican"
label values pid_2 pi

foreach var in inferences special_supporters policy_supporters gain_supporters likeyou_supporters placement {
	summ `var' 
	replace `var' = (`var' - r(min))/(r(max)-r(min))
	}
	
summ inparty
gen in01 = (inparty - r(min))/(r(max)-r(min))


factor *_supporters, pcf
	/*EV = 2.37, proportion = 0.6
	Special and Gain = -0.76 and -0.71; Policy and Like you = 0.79 and 0.81
	*/

rotate
predict factor1
summ factor1
gen motives = (factor1 - r(min))/(r(max)-r(min))


/*********************************************
Models
*********************************************/

eststo clear
eststo: regress support01 i.treat_4 i.change
eststo: regress argdiff01 i.treat_4 i.change
eststo: regress inferences i.treat_4 i.change
eststo: regress prox01 i.treat_4 i.change
eststo: regress motives i.treat_4 i.change
eststo: regress in01 i.treat_4 i.change

esttab using "exp4_table1.rtf", replace onecell se star(+ 0.1 * 0.05 ** 0.01) ///
		nobaselevels b(2) label ///
		mtitles("Policy Support" "Argument Difference" "Inferences" "Proximity" "Motives" "In-Party Affect") ///
		title("{\b Table 2}: Results from September 2020 MTurk Replication Experiment") ///
		addnote("All DVs range from 0-1; Argument Difference = Difference in Argument Ratings; Inferences = beliefs about economic consequences of policy; Motives = perceived motives of pro-reform legislators; In-Party = in-party thermometer.")
		
log close
